
const FromTypes = {
    //成功
    normalSuccess: {name: "normalSuccess", title: "操作成功", backDelta: 1, firstText: "操作成功", decText: "" },
    //自助部署
    selfDeploy: {name: "selfDeploy", title: "部署成功", backDelta: 4, firstText: "商户部署成功", decText: "" },
    //代理商开户
    openAgent: {name: "openAgent", title: "申请成功", backDelta: 2, firstText: "代理商开户成功", decText: {} },
};

Page({

    onLoad: function (options) {
        let values = JSON.parse(options.params);
        let fromType = FromTypes[values.fromPage];
        if (fromType.name === 'openAgent') {
            fromType.decText = {
                assistId: values.assistId,
                userId: values.userId,
                password: values.password
            };
        }

        this.setData({
            fromType: fromType
        });

        wx.setNavigationBarTitle({
            title: this.data.fromType.title
        })
    },

    nextStep: function () {
        wx.navigateBack({
            delta: this.data.fromType.backDelta
        });
    }

});